<?php
/**
 * cron获取更新状态
 * @code-encode utf-8
 * @data-encode utf-8
 */


class db_cron_start_id extends db_base
{
	var $tbl_name = "cron_start_id";

	/**
	 * 构造函数
	 */
	function __construct()
	{
		parent::db_base();
	}
	
	
	/*
	* 根据类型取数据
	*/
	function cron_get_item_by_type($type,$process)
	{
	
		$sql =" select * from cron_start_id where type='".$type."' and process = {$process}";
	
		$res = $this->select($sql);
		
		return $res[0];
	}

	/*
	 * 插入cron数据 
	 */
	function cron_replace_into_data($type,$start_id,$process)
	{
		$arr_insert_data["type"] = $type;
		$arr_insert_data["start_id"] = $start_id;
		$arr_insert_data["process"] = $process;
		$arr_insert_data["update_time"] = Date::get_date_time();
		
		$res = $this->insert($this->tbl_name, $arr_insert_data,"",true);
		
		return $res;
	}


}